<?php

class CS_Model extends CS_Core
{
	public $engine;

	public function __construct()
	{
		if(CS_Config::read('Database') !== false)
		{
			$engine_class = 'CS_Model_Engine_'.ucfirst(CS_Config::read('Database.driver'));
			$this->engine = new $engine_class;

			$this->engine->connect();
		}
	}

	public function getTableList()
	{
		if(is_resource($this->engine->connection))
		{
			return $this->engine->showTables();
		} else {
			return array();
		}
	}
}
